﻿using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace WebMiddleware.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    public class MainWindowController : ControllerBase
    {
        private readonly IMainWindow _mainWindow;

        public MainWindowController(IMainWindow mainWindow)
        {
            _mainWindow = mainWindow;
        }

        [HttpGet]
        public async Task Show()
        {
            await _mainWindow.ShowAsync();
        }

        [HttpGet]
        public async Task Hide()
        {
            await _mainWindow.HideAsync();
        }

        [HttpGet]
        public async Task Close()
        {
            await _mainWindow.CloseAsync();
        }
    }
}
